package controller;

import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;

public class IndexController extends Controller {

	public void index(){
		System.out.println("进来？");
		render("/WEB-INF/index.html");
	}
	
	public void select(){
		String name = getPara("name");
		if(name.equals("")){
			
		}else{
			Record user = Db.findFirst("select * from user where name=?",name);
			if(user == null){
				System.out.println("无该用户。");
				renderJson("无该用户");
			}
		}
		System.out.println("ajax:"+name);
	}
	
	public void add(){
		System.out.println("增加用户");
		render("/WEB-INF/adduser.html");
	}
	
}
